from django.shortcuts import render
from rest_framework.generics import GenericAPIView
from rest_framework import mixins, status, viewsets, views
from rest_framework.response import Response

from utils.mongo import spider
# Create your views here.


class MongoAPIView(views.APIView):
  def get(self, request, *args, **kwargs):
    key = request.query_params.get('key')
    page_size = request.query_params.get('page_size')
    page_num = request.query_params.get('page_num')
    res = spider(key, page_size, page_num)
    return Response(data=res)
